﻿<?xml version="1.0" encoding="utf-8" ?>
<Feature id="Forum" name="Forum Feature Configuration">
	<Dependencies>
		<Dependency type="feature">DataScarfFeature.xml</Dependency>
	</Dependencies>
	
	<BusinessRules>
		<BusinessRule name="getAllCompanyForumSetGroupsForParent" security="disabled">
			<Option value="$ArticlesRemoteTier$">
				<RemoteRule url="$ArticlesRemoteTier$" />
				<LocalClass name="Forums.ForumBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="getUserCommentAppFunctions" security="disabled">
			<Option value="$ArticlesRemoteTier$">
				<RemoteRule url="$ArticlesRemoteTier$" />
				<LocalClass name="Forums.ForumBizRules,ScsCore" />
			</Option>
		</BusinessRule>
    <BusinessRule name="translateForumThread" security="disabled">
      <Option value="$ArticlesRemoteTier$">
        <RemoteRule url="$ArticlesRemoteTier$" />
        <LocalClass name="Forums.ForumBizRules,ScsCore" />
      </Option>
    </BusinessRule>
  </BusinessRules>

  <BusinessRules>
    <BusinessRule name="postExtendForumsexecuteCompanyBackup" security="disabled" postExtends="executeCompanyBackup">
      <LocalClass name="Forums.ForumBackupBizRules,ScsCore" />
    </BusinessRule>
    <BusinessRule name="postExtendForumsexecuteCompanyRestore" security="disabled" postExtends="executeCompanyRestoreFromZip">
      <LocalClass name="Forums.ForumBackupBizRules,ScsCore" />
    </BusinessRule>
    <BusinessRule name="getForumBackupRestoreTemplate" security="disabled" postExtends="getBackupRestoreDeploymentOtionDisplay">
      <LocalClass name="Forums.ForumBackupBizRules,ScsCore" />
    </BusinessRule>
  </BusinessRules>

  <BusinessRules>
		<BusinessRule name="scarfForumSet" security="disabled">
			<Option value="$ArticlesRemoteTier$">
				<RemoteRule url="$ArticlesRemoteTier$" />
				<LocalClass name="Forums.ForumScarfBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="fullyScarfForumThreads" security="disabled">
			<Option value="$ArticlesRemoteTier$">
				<RemoteRule url="$ArticlesRemoteTier$" />
				<LocalClass name="Forums.ForumScarfBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="scarfForumThreadPage" security="disabled">
			<Option value="$ArticlesRemoteTier$">
				<RemoteRule url="$ArticlesRemoteTier$" />
				<LocalClass name="Forums.ForumScarfBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="scarfForumThreadPosts" security="disabled">
			<Option value="$ArticlesRemoteTier$">
				<RemoteRule url="$ArticlesRemoteTier$" />
				<LocalClass name="Forums.ForumScarfBizRules,ScsCore" />
			</Option>
		</BusinessRule>
		<BusinessRule name="filterExistingForumPosts" security="disabled">
			<Option value="$ArticlesRemoteTier$">
				<RemoteRule url="$ArticlesRemoteTier$" />
				<LocalClass name="Forums.ForumScarfBizRules,ScsCore" />
			</Option>
		</BusinessRule>
	</BusinessRules>

	<BusinessObjects>
    <BusinessObject injects="CompanyBackup">
      <Field name="backupCompanyForums" type="Boolean"/>
    </BusinessObject>

    <BusinessObject type="ForumScarfRuntimeInfo" extends="ScarfRuntimeInfo">
			<Field name="totalThreadsFound" type="Integer" />
			<Field name="totalPostsFound" type="Integer" />
			<Field name="totalNewUsersFound" type="Integer" />
			<Field name="uniqueUsers" type="Map" xmlOut="rawElement" />
			<Field name="threadsWithImages" type="Map" xmlOut="rawElement" />
			<Method name="totalUsersFound" language="jscript.NET" xmlOut="attrib"><![CDATA[
				return self.getItem("uniqueUsers").Count;
			]]></Method>
		</BusinessObject>

		<BusinessObject type="ContentReplacement">
      <Field name="type" type="String" />
			<Field name="regex" type="String" />
			<Field name="replace" type="String" />
		</BusinessObject>

		<BusinessObject type="ImageLocation">
			<Field name="regex" type="String" />
			<Field name="dir" type="String" />
		</BusinessObject>

    <BusinessObject type="LastForumPostInfo">
      <Field name="forumId" type="String" />
      <Field name="lastPostTime" type="String" />
    </BusinessObject>
		
		<BusinessObject type="ForumScarf" key="id" extends="SiteScarf">
			<Field name="userIdPrefix" type="String" />
			<Field name="forumPagePageIndexInfo" type="String" />
      <Field name="forumGroupsUrl" type="String" />
			<Field name="forumPageUrl" type="String" />
			<Field name="threadPageUrl" type="String" />
			<Field name="threadPagePageIndexInfo" type="String" />
			<Field name="forumPageIndexMultiplier" type="Integer">1</Field>
			<Field name="threadPageIndexMultiplier" type="Integer">1</Field>

			<Field name="expectedThreadsPerPage" type="Integer">-1</Field>
			<Field name="expectedPostsPerPage" type="Integer">-1</Field>
			<Field name="runtime" type="ForumScarfRuntimeInfo" />

			<Field name="groupRegex" type="String" />
			<Field name="forumPagesRegex" type="String" />
			<Field name="forumRegex" type="String" />
			<Field name="threadPagesRegex" type="String" />
			<Field name="threadRegex" type="String" />
			<Field name="postRegex" type="String" />
			<Field name="postSiteImageRegex" type="String" />
			<Field name="postReplacements" type="List(ContentReplacement)" />
			<Field name="imageLocations" type="List(ImageLocation)" />

			<Field name="fullForumScan" type="Boolean" />

      <Field name="ignoreForumGroups" type="String" />
      <Field name="ignoreForums" type="String" />
      <Field name="ignoreUsers" type="String" />
      <Field name="leaveExtContactOptionsAlone" type="String" />

      <Field name="schedulerRange" type="String" />
		</BusinessObject>
	</BusinessObjects>
	
	<ClassFactory id="BizProcs">
		<Class type="Forums.Gui.ForumBizProc,ScsCore" name="Forums"/>
		<Class type="Forums.Gui.ForumScarferBizProc,ScsCore" name="ForumScarfer"/>
	</ClassFactory>

  <ApplicationFunctions id="Forum" description="Discussion Forum Access">
    <AppFunction id="ManageForumGroups" description="Overall forum group and forum management" />
    <AppFunction id="ManageForumPosts" description="Manage forum posts" />
    <AppFunction id="CreateForumPosts" description="Create new forum posts" />
  </ApplicationFunctions>
  <ApplicationFunctions id="UserCommentsSec" description="User Comments on Articles">
		<DynamicAppFunction id="UserComments" bizrule="getUserCommentAppFunctions" bizobjType="DynamicAppFunction" scope="companyId"/>
  </ApplicationFunctions>
</Feature>
